<template>
  <div class="c-pb160 copyNot c-bg-white">
    <audio id="audioSelf" @ended="playAudioSelfEnd" class="c-pf c-p-l-100"></audio>
    <div v-if="testRes!=null" class="c-p c-ph24">
      <div>
        <div>
          <div class="c-pt30" v-if="testRes">
            <div class="c-pa c-p-t40 c-textAlign-c c-p-r24" @click="drawNowCom" v-if="testRes.isCheck != -1&&(testRes.isMatch==2 || testRes.isMatch==3)">
              <div class="iconfont icon-zhengshu1 c-fs38 c-fc-sorange"></div>
              <div class="c-fs20 c-fc-xblack">考试证书</div>
            </div>
            <div class="c-pa c-p-t40 c-textAlign-c" :class="((testRes.isShowRanking == 1 && testRes.isCheck != -1) && (testRes.isMatch==2 || testRes.isMatch==3))?'c-p-r136':'c-p-r24'" @click="ranking(1)" v-if="testRes.isShowRanking == 1 && testRes.isCheck != -1">
              <div class="iconfont icon-paihangbang c-fs38 c-fc-linerColorRed"></div>
              <div class="c-fs20 c-fc-xblack">排行榜</div>
            </div>
            <div class="c-flex-row c-aligni-center">
              <img class="c-ww70 c-brp50 c-hh70" :src="$addXossFilter(testRes.headimgurl, require('@/assets/defult_head.png'))" alt="">
              <div class="c-fs28 c-fc-xblack c-fw-b c-ml16 c-text-ellipsis1 c-ww320">{{testRes.nickname}}</div>
            </div>
            <div class="c-mt32 c-ww280 c-mlr-auto c-hh280 c-p c-mb40" v-if="testRes.enableShowScore">
              <x-circle :percent="0" :strokeWidth="5" :stroke-color="['#9AAAFF', '#6C83FF']" :trailWidth="5" :trailColor="'#d3daff'" anticlockwise>
                <div class="">
                  <span class="c-fs72">
                    {{testRes.enableShowScore == 0?'--':testRes.enableRating==-1||(testRes.enableRating==1&&testRes.isCheck != -1)?
                      (testRes.totalpoins >= 100 ?Number(testRes.totalpoins).toFixed(0) : testRes.totalpoins):'待批阅'}}
                  </span>
                  <span class="c-fs26 score-text" v-if="testRes.enableShowScore == 1&&(testRes.enableRating==-1||(testRes.enableRating==1&&testRes.isCheck != -1))">分</span>
                </div>
              </x-circle>
            </div>
            <div v-else-if="testRes.resultCustomizeWord" class="c-mt80 c-mb40">
              <div class="c-ww450 c-text-ellipsis2 c-textAlign-c c-center c-fs30 c-fw600">{{testRes.resultCustomizeWord}}</div>
            </div>
            <div class="c-mb50" v-if="testRes.enableShowAccuracy ==1">
              <div class="c-br28 c-ww320 c-lh56 c-m-0auto c-fc-gray c-fs24 c-textAlign-c c-bg-fa">
                您已超越{{testRes.isCheck != -1?Number(testRes.overstep*100).toFixed(0)+'%':' -- '}}的学员
              </div>
            </div>
            <div :class="testRes.enableShowScore||testRes.resultCustomizeWord||testRes.enableShowAccuracy ==1?'':'c-mt56'" class=" c-flex-row c-justify-center c-aligni-center c-textAlign-c" v-if="testRes.type==1 || (testRes.type == 2 && testRes.paperType == 1)">
              <div v-if="testRes.enableShowAccuracy ==1" class="c-flex-1">
                <div class="c-fs30 c-fc-mblue">{{(testRes.enableRating==-1||(testRes.enableRating==1&&testRes.isCheck != -1))?Number(testRes.accuracy*100).toFixed(0)+'%':'--'}}</div>
                <div class="c-fs20 c-fc-gray">正确率</div>
              </div>
              <div v-if="testRes.enableShowRightNum ==1" class="c-flex-1">
                <div class="c-fs30 c-fc-mblue">{{(testRes.enableRating==-1||(testRes.enableRating==1&&testRes.isCheck != -1))?testRes.rightNum:'--'}}</div>
                <div class="c-fs20 c-fc-gray">正确题数</div>
              </div>
              <div class="c-flex-1">
                <div class="c-fs30 c-fc-mblue">{{testRes.normalFinish}}</div>
                <div class="c-fs20 c-fc-gray">已做题数</div>
              </div>
              <div class="c-flex-1">
                <div class="c-fs30 c-fc-mblue">{{testRes.unCheckNum}}</div>
                <div class="c-fs20 c-fc-gray">待批阅数</div>
              </div>
              <div class="c-flex-1">
                <div class="c-fs26 c-fc-mblue">{{testRes.ansTime}}</div>
                <div class="c-fs20 c-fc-gray">耗时</div>
              </div>
            </div>
          </div>
          <template v-if="testRes && testRes.isCheck != -1">
            <div class="c-ph24 c-fw-b c-fs30 c-lh50 c-fc-xblack c-mt56" v-if="testRes.type==2">{{testRes.remarkTitle}}</div>
          </template>
          <div class="c-ph24 c-fc-sxblack c-fs24 c-lh50 c-pt20 copyNot" v-if="testRes.isRemark!=-1 && testRes.isCheck != -1&&review!=''">
            <span class="c-fc-black fl c-ws-n">点评：</span><span v-html="review" class="c-fc-sxblack c-ww-bw c-ww-ba c-contexty-scroll rich-text"></span>
            <!-- <span v-if="testRes.remarkType == 1 && (testRes.type != 1)">{{review}}</span> -->
          </div>
        </div>
        <div class="c-aligni-center c-fs28 c-mt56 c-ww500 c-m-0auto" v-if="testRes != null">
          <div v-if="testRes.enableResurvey==1" @click="goTest(1)" class="c-hh76 c-fc-white c-flex-row c-br36 c-justify-center c-aligni-center bg-linearColor">
            <div>再次测试{{testRes.restartTime>0?'(可再考'+testRes.leftRestartTime+'次)':''}}</div>
          </div>
          <div v-if="entyCenter==1" @click="clickGoList" class="c-mt30 c-fc-mblue c-bd1-ssmblue c-br36 c-hh76 c-flex-row c-justify-center c-aligni-center">
            <div>返回主页</div>
          </div>
          <div @click="goNextExam" v-if="testRes.nextId!=0" class="c-mt30 c-fc-mblue c-bd1-ssmblue c-br36 c-flex-1 c-hh70 c-flex-row c-justify-center c-aligni-center">
            <div>下个测试</div>
          </div>
        </div>
        <div class="c-fs24 c-fc-xblack c-pt32 c-fw-b" v-if="testRes.visitInlet">关联课程</div>
        <div class="c-flex-row c-pt32" v-if="testRes.visitInlet" @click="clickGoDetail(testRes.visitInlet.prodType,testRes.visitInlet.id,testRes.visitInlet.courseType)">
          <div class="c-ww180 c-flex-shrink0">
            <div class="c-ww180 c-maxh120 c-text-hidden c-p">
              <img class="c-w100 imgCloseBig" :src="$addXossFilter(testRes.visitInlet.cover, require('@/assets/defult270.png'))" alt="" />
              <div class="c-fs16 c-fc-white c-ph6 c-pv2 c-translucent-balck60 c-br20 c-pa c-p-r8 c-p-b8">
                {{testRes.visitInlet.prodType==61?'知识套餐':testRes.visitInlet.prodType==9?'专栏':testRes.visitInlet.prodType==11?'测评':
                  testRes.visitInlet.prodType==78?'训练营':testRes.visitInlet.prodType==5?(testRes.visitInlet.courseType==2?'图文':testRes.visitInlet.courseType==1?'音频':'视频'):''}}
              </div>
            </div>
          </div>
          <div class="c-ml20 c-flex-column c-pb24 c-bd-b1 c-text-hidden c-flex-grow1">
            <div class="c-fs24 c-fc-xblack c-mt16 c-text-ellipsis1">
              {{testRes.visitInlet.name}}
            </div>
            <!-- testRes.visitInlet.prodType -->
            <div class="c-flex-row c-mt24 c-aligni-center">
              <div class="c-fs18 c-fc-gray c-ml26" v-if="
                (testRes.visitInlet.prodType==142&&(cfg&&cfg.enableShowModuleView == 1 || (cfg&&cfg.enableShowModuleView == 0&&!(cfg&&cfg.enableHiddenModules && cfg&&cfg.enableHiddenModules.includes(142))))) ||
                  (testRes.visitInlet.prodType==41&&(cfg&&cfg.enableShowModuleView == 1 || (cfg&&cfg.enableShowModuleView == 0&&!(cfg&&cfg.enableHiddenModules && cfg&&cfg.enableHiddenModules.includes(41))))) ||
                  (testRes.visitInlet.prodType==61&&(cfg&&cfg.enableShowModuleView == 1 || (cfg&&cfg.enableShowModuleView == 0&&!(cfg&&cfg.enableHiddenModules && cfg&&cfg.enableHiddenModules.includes(61))))) ||
                  (testRes.visitInlet.prodType==9&&(cfg&&cfg.enableShowModuleView == 1 || (cfg&&cfg.enableShowModuleView == 0&&!(cfg&&cfg.enableHiddenModules && cfg&&cfg.enableHiddenModules.includes(9))))) ||
                  (testRes.visitInlet.prodType==78&&(cfg&&cfg.enableShowModuleView == 1 || (cfg&&cfg.enableShowModuleView == 0&&!(cfg&&cfg.enableHiddenModules && cfg&&cfg.enableHiddenModules.includes(78)))))||
                  (testRes.visitInlet.prodType==5&&(cfg&&cfg.enableShowModuleView == 1 || (cfg&&cfg.enableShowModuleView == 0&&!(cfg&&cfg.enableHiddenModules && cfg&&cfg.enableHiddenModules.includes(5)))))">
                {{testRes.visitInlet.subscribers}}人参与
              </div>
            </div>
          </div>
        </div>
        <div v-if="testRes.enableShowAnswerCard==1">
          <div class="c-fs30 c-pt60 c-pb10 c-fc-xblack c-fw-b">答题卡</div>
          <div class="" v-for="(item, index) in answerCardList" :key="index" @click="goAnalysis(item.number)">
            <!-- 1单选题，4判断题，2多选题 -->
            <div v-if="item.type == 1 || item.type == 2 || item.type == 4||item.smallType == 1||item.smallType == 2||item.smallType == 4" class="c-w100 c-lh60 c-bd1-e6 c-flex-row c-aligni-center c-justify-sb c-mt20 c-ph20">
              <div class=" c-flex-row">
                <div class="c-fc-gray c-fs20 c-flex-row c-aligni-center">
                  <div>{{item.number ? item.number : index + 1}}.<span>【{{item.type == 1 ? '单选题' : item.type == 2 ? '多选题' : item.type == 4 ? '判断题':'材料演示题'}}】</span></div>
                </div>
                <div v-if="item.type != 4&&item.smallType!=4" class="c-fs26 c-fc-xblack c-ml10">{{item.userAnswer ? item.userAnswer : '未答题'}}</div>
                <div v-else class="c-fs24 c-fc-xblack c-ml10">{{item.userAnswer ? (item.userAnswer == '-1' ? '错误' : '正确') : '未答题'}}</div>
                <div class="c-fs18 iconfont c-ml20" :class="item.isRight == 1 ? ' c-fc-mblue':'c-fc-xlred'">{{item.isRight == 1 ? '&#xe6ea;' : '&#xe8fd;'}}</div>
              </div>
            </div>
            <!-- 5填空题 -->
            <div v-if="item.type == 5||item.smallType == 5" class=" c-w100 c-bd1-e6 c-mt20 c-ph20">
              <span class="c-fc-gray c-fs20">
                <span>{{item.number ? item.number : index + 1}}.<span>【{{item.type == 5?'填空题':'材料演示题'}}】</span></span>
              </span>
              <span class="c-fs26 c-fc-xblack c-lh60" v-for="(sItem, sindex) in item.userAnswer" :key="sindex">
                <span class="c-mr10">{{sItem.value ? sItem.value : '未答题'}}</span>
              </span>
              <span class="c-fs18 iconfont" :class="item.isRight == 1 ? ' c-fc-mblue':'c-fc-xlred'">{{item.isRight == 1 ? '&#xe6ea;' : '&#xe8fd;'}}</span>
            </div>
            <!-- 11完型填空 -->
            <div v-if="item.type == 11" class=" c-w100 c-bd1-e6 c-mt20 c-ph20">
              <span class="c-fc-gray c-fs20">
                <span>{{item.number ? item.number : index + 1}}.<span>【完型填空】</span></span>
              </span>
              <span v-if="item.userAnswer">
                <span class="c-fs26 c-fc-xblack c-lh60" v-for="(sItem, sindex) in item.userAnswer" :key="sindex">
                  <span class="c-mr10">{{sItem.value ? sItem.value : '未答题'}}</span>
                  <span class="c-fs18 iconfont c-mr10" :class="sItem.isRight == 1 ? ' c-fc-mblue':'c-fc-xlred'">{{sItem.isRight == 1 ? '&#xe6ea;' : '&#xe8fd;'}}</span>
                </span>
              </span>
              <span v-else><span class="c-mr10 c-fs26 c-fc-xblack c-lh60">未答题</span></span>
            </div>
            <!-- 3简答题 -->
            <div v-if="item.type == 3||item.smallType == 3" class=" c-w100 c-bd1-e6 c-mt20 c-ph20 c-pb20">
              <div class="c-fc-gray c-fs20 c-hh64 c-flex-row c-aligni-center c-justify-sb">
                <div>{{item.number ? item.number : index + 1}}.<span>【{{item.type == 3?'问答题':'材料演示题'}}】</span></div>
                <div class="c-fc-xlred c-fs22" v-if="testRes.isCheck != -1">{{item.score}} 分</div>
              </div>
              <div class="c-fs26 c-fc-xblack">
                <span>{{item.isCheck == -1?'未批阅':(item.userAnswer ? item.userAnswer : '未答题')}}</span>
              </div>
              <div>
                <div class="c-flex-row c-flexw-wrap">
                  <div class="c-ww120 c-hh120 c-mr16 c-mt20" v-for="(imgItem, imgIndex) in item.imgArr" :key="imgIndex">
                    <img class="c-w100 c-maxh120" :src="$addXossFilter(imgItem.url)" />
                  </div>
                </div>
                <div class="c-flex-row c-flexw-wrap c-pt20">
                  <div @click.stop="clickPlayAudio(imgItem.url)" v-for="(imgItem,index) in item.audioArr" :key="index" :class="index % 3 == 0 ? '' : 'c-ml20'" class="c-ww120 c-hh60 c-br30 theme-bg-10 c-pl24 c-pr10 c-p c-flex-row c-aligni-center c-mb20">
                    <div class="box c-ww32">
                      <div class="wifi-symbol">
                        <div class="wifi-circle first theme-bd2"></div>
                        <div class="wifi-circle second theme-bd2" :class="playAduioSrc == imgItem.url?'seconAnimation':''"></div>
                        <div class="wifi-circle third theme-bd2" :class="playAduioSrc == imgItem.url?'thirdAnimation':''"></div>
                      </div>
                    </div>
                    <div class="c-fs20 theme-fc">{{imgItem.time}}"</div>
                  </div>
                </div>
              </div>
            </div>
            <!-- 阅读理解题 -->
            <div v-if="item.type == 9" class=" c-w100 c-bd1-e6 c-mt20 c-ph20 c-pb20">
              <div class="c-fc-gray c-fs20 c-pt20 c-flex-row c-aligni-center c-justify-sb">
                <div>{{item.number ? item.number : index + 1}}.<span>【阅读理解题】</span></div>
              </div>
              <div class="c-fs26 c-fc-xblack">
                <div class="" ref="readDiv">
                  <span ref="readSpan" class="c-fs26" v-for="(tItem, tindex) in item.minorQuestion" :key="tindex">
                    <span class="c-pr20" v-if="tItem.type == 1">{{tItem.userAnswer ? tItem.userAnswer : '未答题'}}<span class="c-fs18 iconfont c-pl10" :class="tItem.isRight == 1 ? ' c-fc-mblue':'c-fc-xlred'">{{tItem.isRight == 1 ? '&#xe6ea;' : '&#xe8fd;'}}</span></span>
                    <span class="c-pr20" v-if="tItem.type == 2">{{tItem.userAnswer ? tItem.userAnswer : '未答题'}}<span class="c-fs18 iconfont  c-pl10" :class="tItem.isRight == 1 ? ' c-fc-mblue':'c-fc-xlred'">{{tItem.isRight == 1 ? '&#xe6ea;' : '&#xe8fd;'}}</span></span>
                    <span class="c-pr20" v-if="tItem.type == 4">{{tItem.userAnswer ? (tItem.userAnswer == '-1' ? '错误' : '正确') : '未答题'}}<span class="c-fs18 iconfont  c-pl10" :class="tItem.isRight == 1 ? ' c-fc-mblue':'c-fc-xlred'">{{tItem.isRight == 1 ? '&#xe6ea;' : '&#xe8fd;'}}</span></span>
                    <span v-if="tItem.type == 5">
                      <span class="c-fs26 c-fc-xblack" v-for="(sItem, sindex) in tItem.userAnswer" :key="sindex">
                        <span class="c-mr20 ">{{sItem.value ? sItem.value : '未答题'}}</span>
                      </span>
                      <span class="c-fs18 iconfont" :class="tItem.isRight == 1 ? ' c-fc-mblue':'c-fc-xlred'">{{tItem.isRight == 1 ? '&#xe6ea;' : '&#xe8fd;'}}</span>
                    </span>
                  </span>
                </div>
                <div v-for="(tItem, tindex) in item.minorQuestion" :key="tindex" v-if="tItem.type == 3" class="c-w100">
                  <div class="c-fc-gray c-fs20 c-flex-row c-aligni-center c-justify-end c-w100">
                    <div class="c-fc-xlred c-fs22" v-if="testRes.isCheck != -1">{{tItem.score}} 分</div>
                  </div>
                  <div class="c-fs26 c-fc-xblack c-mt20">
                    <span>{{tItem.isCheck == -1?'未批阅':(tItem.userAnswer ? tItem.userAnswer : '未答题')}}</span>
                  </div>
                  <div>
                    <div class="c-flex-row c-flexw-wrap">
                      <div class="c-ww120 c-hh120 c-mr16 c-mt20" v-for="(imgItem, imgIndex) in tItem.imgArr" :key="imgIndex">
                        <img class="c-w100 c-maxh120" :src="$addXossFilter(imgItem.url)" />
                      </div>
                    </div>
                    <div class="c-flex-row c-flexw-wrap c-pt20">
                      <div @click.stop="clickPlayAudio(audioItem.url)" v-for="(audioItem,index) in tItem.audioArr" :key="index" :class="index % 3 == 0 ? '' : 'c-ml20'" class="c-ww120 c-hh60 c-br30 theme-bg-10 c-pl24 c-pr10 c-p c-flex-row c-aligni-center c-mb20">
                        <div class="box c-ww32">
                          <div class="wifi-symbol">
                            <div class="wifi-circle first theme-bd2"></div>
                            <div class="wifi-circle second theme-bd2" :class="playAduioSrc == audioItem.url?'seconAnimation':''"></div>
                            <div class="wifi-circle third theme-bd2" :class="playAduioSrc == audioItem.url?'thirdAnimation':''"></div>
                          </div>
                        </div>
                        <div class="c-fs20 theme-fc">{{audioItem.time}}"</div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div v-if="testRes!=null">
      <div class="c-mt40">
        <div class="c-mt32 c-pt28 c-ph24" v-if="testRes.courseInfo && testRes.courseInfo.length > 0">
          <div class="c-fs28 c-fc-xblack">相关推荐</div>
          <div class="c-mt28" v-for="(item, index) in testRes.courseInfo" :key="index">
            <div class="c-flex-row" @click="clickItem(item.linkType, item.id)">
              <div class="c-ww160 c-flex-shrink0 c-maxh106 c-text-hidden c-br6">
                <img v-if="item.linkType != 8" class="c-w100 imgCloseBig c-br6" :src="$addXossFilter(item.cover, require('@/assets/defult270.png'))" @error="item.cover = require('@/assets/defult270.png')" alt="" />
                <template v-else>
                  <img v-if="item.cover" class="c-w100 c-center imgCloseBig" :src="$addXossFilter(item.cover)" alt="" />
                  <img v-else-if="OFFICE_TYPE.indexOf(item.format) > -1" class="c-ww100 c-center imgCloseBig" src="../../../assets/i/wap/datum/icon_doc.png" alt="" />
                  <img v-else-if="IMG_TYPE.indexOf(item.format) > -1" class="c-ww100 c-center imgCloseBig" src="../../../assets/i/wap/datum/icon_pic.png" alt="" />
                  <img v-else-if="AUDIO_TYPE.indexOf(item.format) > -1" class="c-ww100 c-center imgCloseBig" src="../../../assets/i/wap/datum/icon_audio.png" alt="" />
                  <img v-else-if="VIDEO_TYPE.indexOf(item.format) > -1" class="c-ww100 c-center imgCloseBig" src="../../../assets/i/wap/datum/icon_video.png" alt="" />
                  <img v-else class="c-ww100 c-center imgCloseBig" src="../../../assets/i/wap/datum/icon_com.png" alt="" />
                </template>
              </div>
              <div class="c-flex-column c-justify-sb c-maxh106 c-flex-grow1 c-pl20 c-w0">
                <div class="c-fs22 c-lh32 c-text-ellipsis1 c-fc-xblack">{{item.name}}</div>
                <div v-if="item.linkType == 1051 || item.linkType == 1052 || item.linkType == 1053" class="c-fs18 c-fc-gray">讲师：{{item.teacherName!=''&&item.teacherName!=null?item.teacherName:'未知'}}</div>
                <div class="c-flex-row c-justify-sb c-w100">
                  <div class="c-fs18 c-fc-white c-ph12 c-hh30 c-lh32 c-br4 theme-bg">{{item.linkType == 1051 ? '视频' : item.linkType == 1052 ? '音频' : item.linkType == 1053 ? '图文' : prodTypeText[item.linkType]}}</div>
                  <template v-if="item.linkType == 1051 || item.linkType == 1052 || item.linkType == 1053 || item.linkType == 9 || item.linkType == 10 || item.linkType == 51">
                    <div class="c-fs22 theme-fc" v-if="item.isSaleOnly==1">
                      <span class="c-fs22" v-if="item.price && item.payType== 2">{{'￥' | iosPriceFilter(item.optimal)}}</span><span>{{item.payType | priceValueFilter(item.price, item.prodType, item.optimal)}}</span>
                    </div>
                    <div v-else-if="item.isSaleOnly==0&&item.isSaleTogether==1" class="c-fs22  theme-fc">关联售卖</div>
                  </template>
                  <template v-else>
                    <div class="c-fs22 theme-fc">
                      <template v-if="item.linkType == 7 || item.linkType == 61 || item.linkType == 78 || item.linkType == 8 || item.linkType == 75 || item.linkType == 77 || item.linkType == 11 || item.linkType == 41 || item.linkType == 12">
                        <span class="c-fs22" v-if="item.price && item.payType== 2">{{'￥' | iosPriceFilter(item.optimal)}}</span><span>{{item.payType | priceValueFilter(item.price, item.prodType, item.optimal)}}</span>
                      </template>
                    </div>
                  </template>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div v-if="testRes != null">
      <div class="c-fs28 c-mt40 c-pf c-p-b0 c-w100 c-bg-white c-maxw640" style="box-shadow:0px 0px 29px 3px rgba(0, 0, 0, 0.06);" v-if="(testRes.enableShowAnswer!=0||testRes.isOpenShare==1)">
        <div class="c-ph24 c-pv20">
          <div class="c-bd1-ccc c-flex-row c-aligni-center c-justify-sb c-hh68 c-br36">
            <div v-if="testRes.enableShowAnswer!=0" :class="testRes.isOpenShare==1?'c-bd-r1-ccc':''" @click="goAnalysis(1)" class="c-lh70 c-fc-mblue  c-flex-1 c-br6 c-flex-row c-justify-center c-aligni-center">
              <div>查看答卷</div>
            </div>
            <div v-if="testRes.isOpenShare==1" @click="examShare(1)" class="c-fc-mblue  c-flex-1 c-br6 c-flex-row c-justify-center c-aligni-center c-lh70">
              <div>分享成绩</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <cj-popup v-if="testRes!=null" v-model="showCg" class="c-bg-transparent">
      <div v-if="(testRes.isReward != 1&&(testRes.isDrawReward == 2||testRes.isDrawReward == 3))||(testRes.isDrawReward==3 &&testRes.isReward == 1 )" class="c-bg-white c-ph48 c-pt60 c-pb40 c-br20 c-ww560">
        <div class="c-ww350 c-m-0auto"><img :src="require('../../../assets/i/wap/exam/sucess.png')" alt=""></div>
        <div class="c-fc-xblack c-fw-b c-fs36 c-textAlign-c c-mt40">恭喜您，顺利过关</div>
        <div @click="goNextExam" class="c-hh72 c-fs28 c-mt40 c-fc-white c-flex-row c-br36 c-justify-center c-aligni-center bg-linearColor">
          <div>{{testRes.nextId!=0 ? '进入下一测试' : '您已通关'}}</div>
        </div>
      </div>
      <div v-if="testRes.isReward == 1 && testRes.isDrawReward == 2 && testRes.rewardType == 2 && testRes.reddemCode.length > 0" class="c-bg-white c-ph48 c-pt60 c-pb40 c-br20 c-ww560">
        <div class="c-ww350 c-m-0auto"><img :src="require('../../../assets/i/wap/exam/sucess.png')" alt=""></div>
        <div class="c-fc-xblack c-fw-b c-fs36 c-textAlign-c c-mt40">恭喜您，顺利过关</div>
        <div class="c-ww430 c-bg-f6 c-m-0auto c-mt24 c-pt16 c-fc-gray c-br10">
          <div class="c-fs22 c-textAlign-c">- 获得奖励 -</div>
          <div class="c-mt24" :class="testRes.reddemCode.length==1?'c-pb24':'c-hh180 c-contexty-scroll '">
            <coupon-item-com :key="index" v-for="(item, index) in testRes.reddemCode" :couponInfo="item" :size="'small'" :showFooter="false" class="c-textAlign-l c-mb16 c-mlr-auto c-ww380">
              <template v-slot:bodyRight>
                <div class="c-w100 c-flex-column c-justify-sb">
                  <div class="c-fs24 c-fc-xblack c-text-ellipsis1 c-textAlign-l">{{item.name}}</div>
                  <div class="c-fs20 c-fc-gray c-text-ellipsis1 c-mt8 c-textAlign-l" v-if="item.validStatus != 1 && item.validStatus != 2">{{item.startAt.replace(/-/g,'.').split(' ')[0]}} - {{item.endAt.replace(/-/g,'.').split(' ')[0]}}</div>
                  <div class="c-fs20 c-fc-gray c-text-ellipsis1 c-mt8 c-textAlign-l" v-else>{{item.validStatus == 1 ? ('领券当日起' + item.validPeriod + '天内可用') : ('领券次日起' + item.validPeriod + '天内可用')}}</div>
                  <div v-if="item.type != 1" class="c-fs20 c-fc-gray c-text-ellipsis1 c-mt8 c-textAlign-l">{{item | couponApplyText}}</div>
                </div>
              </template>
            </coupon-item-com>
            <!-- <div class="c-flex-row c-mlr-auto c-ww380 c-mb16" v-for="(item, index) in testRes.reddemCode" :key="index">
              <div class="c-hh120 c-ww130 c-flex-shrink0" :class="item.type == 1 ? 'dh-left' : 'exchange-left'">
                <div v-if="item.type == 5" class="c-fs20 c-fc-white c-textAlign-c c-text-ellipsis1 c-mt24"><span class="c-fs40">{{Number(item.price)}}</span>折</div>
                <div v-if="item.type == 2 || item.type == 3" class="c-fs40 c-fc-white c-textAlign-c c-text-ellipsis1 c-mt24"><span class="c-fs20">{{'￥' | iosPriceFilter}}</span>{{item.price.split('.')[0]}}</div>
                <div v-if="item.type == 2 || item.type == 3 || item.type == 5" class="c-fs18 c-fc-white c-textAlign-c c-text-ellipsis1">{{Number(item.amount) > 0 ? ('满' + item.amount.split('.')[0] + '元可使用') : '无门槛'}}</div>
                <div v-if="item.type == 1" class="c-fs28 c-fc-white c-textAlign-c c-text-ellipsis1 c-mt40">兑换券</div>
                <div v-else-if="item.type == 4" class="c-fs28 c-fc-white c-textAlign-c c-text-ellipsis1 c-mt40">抵价券</div>
              </div>
              <div :class="item.type != 1 ? 'c-pv12' : 'c-pv20'" class="c-hh120 c-flex-grow1 c-bg-white c-text-hidden c-flex-column c-justify-sb coupon-bd">
                <div class="c-fs24 c-fc-xblack c-text-ellipsis1 c-ph16 c-textAlign-l">{{item.name}}</div>
                <div class="c-fs20 c-fc-gray c-text-ellipsis1 c-ph16 c-textAlign-l" v-if="item.validStatus != 1 && item.validStatus != 2">{{item.startAt.replace(/-/g,'.').split(' ')[0]}} - {{item.endAt.replace(/-/g,'.').split(' ')[0]}}</div>
                <div class="c-fs20 c-fc-gray c-text-ellipsis1 c-ph16 c-textAlign-l" v-else>{{item.validStatus == 1 ? ('领券当日起' + item.validPeriod + '天内可用') : ('领券次日起' + item.validPeriod + '天内可用')}}</div>
                <div v-if="item.type != 1" class="c-fs20 c-fc-gray c-text-ellipsis1 c-ph16 c-textAlign-l">{{item | couponApplyText}}</div>
              </div>
            </div> -->
          </div>
        </div>
        <div v-if="!successGet && !failGet" @click="getCoupons" class="c-hh72 c-fs28 c-mt40 c-fc-white c-flex-row c-br36 c-justify-center c-aligni-center bg-linearColor">
          <div>立即领取</div>
        </div>
        <div v-if="successGet" class="c-ww460 c-fs26 cg-next c-textAlign-c c-mlr-auto coupon-text-fc c-mt44">成功领取{{getNum}}张优惠券！</div>
        <div @click="goMyCoupon" v-if="successGet" class="c-ww460 c-fs20 cg-next c-textAlign-c c-mlr-auto coupon-text-fc">请到"个人中心/优惠券"中查看</div>
        <div v-if="failGet" class="c-ww460 c-fs26 cg-next c-textAlign-c c-mlr-auto coupon-text-fc c-mt56">已抢光！</div>
      </div>
      <div class="c-bg-white c-ph48 c-pt60 c-pb40 c-br20 c-ww560" v-if="testRes.isReward == 1 && testRes.isDrawReward == 2 && testRes.rewardType == 1">
        <div class="c-ww350 c-m-0auto"><img :src="require('../../../assets/i/wap/exam/sucess.png')" alt=""></div>
        <div class="c-fc-xblack c-fw-b c-fs36 c-textAlign-c c-mt40">恭喜您，顺利过关</div>
        <div class="c-ww400 c-bg-f6 c-m-0auto c-mt24 c-pt16 c-fc-gray c-br10">
          <div class="c-fs22 c-textAlign-c">- 获得奖励 -</div>
          <div class="c-ph24 c-mt24 c-pb30 c-textAlign-c">
            <div class="c-fs36 c-clbu c-fw-b">获得{{Number(testRes.rewardPoints)}}{{ customPointName }}</div>
          </div>
        </div>
        <div @click="goMyPoint" class="c-ww460 c-fs24 c-textAlign-c c-mlr-auto c-mt28 c-fc-sblack">请到"个人中心/我的{{ customPointName }}"中查看</div>
      </div>
      <div v-if="testRes.isDrawReward==1" class="c-bg-white c-ph48 c-pt60 c-pb40 c-br20 c-ww560">
        <div class="c-ww170 c-m-0auto"><img :src="require('../../../assets/i/wap/exam/fail.png')" alt=""></div>
        <div class="c-fc-xblack c-fw-b c-fs36 c-textAlign-c c-mt40">很遗憾，闯关失败</div>
        <div class="c-ww400 c-bg-f6 c-m-0auto c-mt24 c-pt16 c-fc-gray c-br10">
          <div class="c-fs22 c-textAlign-c">- 过关条件 -</div>
          <div class="c-pb16">
            <div class="c-flex-row c-aligni-center c-justify-sb c-ph24 c-mt12 ">
              <div class="c-fs22" v-if="testRes.rewardScore!=0"> · 总分达到{{Number(testRes.rewardScore)}}分</div>
              <div class="c-fs22" v-if="testRes.rewardAccuracy!=0"> · 正确率达到{{Number(testRes.rewardAccuracy) + '%'}}</div>
            </div>
            <div class="c-fs22 c-mt16 c-textAlign-l c-ph24" v-if="testRes.rewardRightNum!=0"> · 正确题数达到{{Number(testRes.rewardRightNum)}}题解锁下一测试</div>
          </div>
        </div>
        <div v-if="testRes.enableResurvey==1" @click="goTest(1)" class="c-hh72 c-fs28 c-mt40 c-fc-white c-flex-row c-br36 c-justify-center c-aligni-center bg-linearColor">
          <div>再次测试</div>
        </div>
      </div>
      <div class="c-textAlign-c c-mt24">
        <span @click="closeCg" class="c-fs48 iconfont c-fc-gray">&#xe84e;</span>
      </div>
    </cj-popup>
    <my-loading :showLoading="isShowLoading"></my-loading>
    <examination-cer-new :bigType="1" :prodId="topicId?topicId:paperMainId" ref="examCerNew" :testRes="testRes"></examination-cer-new>
    <!-- <examination-cer-new ref="examCerNew" :testRes="testRes"></examination-cer-new> -->
  </div>
</template>

<script>
import { utilJs } from "@/utils/common.js"
import { PROD_TYPE_MAP } from '@/utils/constant.js';
import { goDetails } from "@/utils/goDetails.js";
import { XCircle } from 'ckjrweb-mp-ui/src/components/index';
import myLoading from "@/plugin/loading/loading.vue";
import { getBindPhoneSetting } from "@/utils/checkUnBindPhone.js";
import examinationCerNew from "@/components/templates/examination/examinationCerNew.vue";
import couponItemCom from "@/components/templates/couponItemCom.vue";
export default {
  name: "ExaminationResult",
  components: {
    myLoading,
    XCircle,
    examinationCerNew,
    couponItemCom
  },
  data() {
    return {
      customPointName: localStorage.getItem("customPointName"),
      theme: localStorage.getItem("colorName") ? localStorage.getItem("colorName") : "mb5_default",
      OFFICE_TYPE: ["doc", "docx", "pdf", "ppt", "pptx", "xls", "xlsx"],
      IMG_TYPE: ["bmp", "jpg", "png", "gif", "svg", "psd", "webp", "jpeg", "eps", "tga", "tiff"],
      AUDIO_TYPE: ["ogg", "mp3", "wav", "asf", "wma", "mp3pro", "real", "ape", "module", "midi", "vqf"],
      VIDEO_TYPE: ["avi", "wmv", "mpeg", "asf", "mpg", "dv", "rm", "rmvb", "mod", "flv", "mp4", "qt", "divx", "mkv", "vob"],
      cfg: JSON.parse(localStorage.getItem("cfg")),
      review: '',
      answerCardList: [],
      testRes: null,
      paperMainId: -1,
      topicId: '',
      isRelevance: '',
      examinationInfo: null,
      isResurvey: false, //支持重测，重测时间是否已到
      ttId: '', //营期ID
      tpId: '', //环节ID
      tlId: '', //课时ID
      duration: 0,
      entyCenter: '',
      showCg: false,
      isShowLoading: false,
      successGet: false,
      failGet: false,
      getNum: 0,
      bindPhoneSetting: null,
      prodTypeText: Object.freeze(PROD_TYPE_MAP),
      playAduioSrc:'',
      uploadAudioList:[]
    };
  },
  created() {
    utilJs.appShare(this);
  },
  activated() {
    setDocumentTitle("测评结果");// eslint-disable-line
    this.topicId = this.$route.query.topicId || '';
    this.paperMainId = this.$route.query.paperMainId;
    this.testRes = null;
    this.answerCardList = [];
    this.examinationInfo = null;
    this.tpId = this.$route.query.tpId || ''; //环节id
    this.ttId = this.$route.query.ttId || '';
    this.tlId = this.$route.query.tlId || '';
    this.duration = this.$route.query.duration || '';
    this.entyCenter = this.$route.query.entyCenter || '';
    this.ckFrom = this.$route.query.ckFrom || '';
    this.isRelevance = this.$route.query.isRelevance || '';
    this.showCg = false;
    this.isShowLoading = false;
    this.successGet = false;
    this.failGet = false;
    this.playAduioSrc = '';
    this.uploadAudioList = []
    // if (this.tpId) {
    //   // 传进度
    //   let data = {
    //     ttId: this.ttId, //营期ID
    //     tpId: this.tpId, //环节ID
    //     tlId: this.tlId, //课时ID
    //     ratio: 100, //完成进度0-100
    //     duration: this.duration
    //   }
    //   utilJs.postMethod(global.apiurl + 'k12/trainings/progress', data, function (res) { });
    // }
    getBindPhoneSetting(global.ckFrom.testpPaper).then(res => {
      this.bindPhoneSetting = res;
    });
    let $this = this;
    //获取测试结果数据
    utilJs.getMethod(global.apiurl + 'exam/completeTest/' + this.paperMainId + '?topicId=' + this.topicId + '&tlId=' + this.tlId, function (res) {
      $this.testRes = res;
      // 判断是否开启考试完成条件
      if (res.traingEnableStandard == true) {
        $this.setProgress(res.isDrawReward)
      } else {
        $this.setProgress(2)
      }
      let nt = (new Date()).getTime();
      let lt = utilJs.getTimeByDate($this.testRes.lastJoinTime);
      if (($this.testRes.intervalTime != 0) && (lt + $this.testRes.intervalTime * 60 * 60 * 1000 > nt)) {
        $this.isResurvey = false;
      } else {
        $this.isResurvey = true;
      }
      if ($this.testRes.isRemark != -1) {
        $this.review = $this.testRes.remark;
      } else {
        $this.review = '';
      }
      $this.$nextTick(() => {
        if ($this.$refs.readDiv) {
          let timer = 0;
          $this.$refs.readDiv.forEach((item, i) => {
            if ($this.$refs.readDiv[i].offsetHeight > 30) {
              $this.$refs.readDiv[0].childNodes.forEach((item, index) => {
                $this.$refs.readSpan[timer].classList.add('c-bd-bd1-E6');
                $this.$refs.readSpan[timer].classList.add('c-pb20');
                $this.$refs.readSpan[timer].classList.add('c-lh70');
                timer++;
              });
            } else {
              $this.$refs.readDiv[i].classList.add('c-pt20')
            }
          });
        }
      })
      if ($this.isRelevance != 1 && $this.testRes.isBarrier == 1 && $this.testRes.enableStandard == 1) {
        if ($this.testRes.isDrawReward == 1) { //1:未达到领取条件  2：达到领取条件但未领取  3：已经领取
          if ($this.testRes.isCheck == -1) { //当有问答题并且未达到领取奖励条件时，暂不提示闯关失败
            $this.showCg = false;
          } else {
            $this.showCg = true;
          }
        } else {
          $this.showCg = true;
        }
        if ($this.testRes.isReward == 1 && $this.testRes.isDrawReward == 2 && $this.testRes.rewardType == 1) {
          $this.drawReward($this.testRes.rewardType, -1, $this.testRes.rewardPoints);
        }
        if ($this.testRes.isReward != 1 && $this.testRes.isDrawReward != 1) {
          utilJs.postMethod(global.apiurl + 'exam/drawReward', { paperMainId: $this.paperMainId }, function (res) {
          });
        }
      } else if ($this.testRes.traingEnableStandard == true) {
        if ($this.testRes.isDrawReward == 1) { //1:未达到领取条件  2：达到领取条件但未领取  3：已经领取
          if ($this.testRes.isCheck == -1) { //当有问答题并且未达到领取奖励条件时，暂不提示闯关失败
            $this.showCg = false;
          } else {
            $this.showCg = true;
          }
        } else {
          $this.showCg = true;
        }
        if ($this.testRes.isReward == 1 && $this.testRes.isDrawReward == 2 && $this.testRes.rewardType == 1) {
          $this.drawReward($this.testRes.rewardType, -1, $this.testRes.rewardPoints, 78);
        }
        if ($this.testRes.isReward != 1 && $this.testRes.isDrawReward != 1) {
          utilJs.postMethod(global.apiurl + 'exam/drawReward', { paperMainId: $this.paperMainId }, function (res) {
          });
        }
      }
      //获取答题卡数据
      utilJs.getMethod(global.apiurl + 'exam/newAnswerCard/' + $this.testRes.examMainId, function (res) {
        $this.answerCardList = res;
        // for (let i = 0; i < res.notAnswerNum; i++) {
        //   $this.answerCardList.push('');
        // }
      });
    });
    if (!this.topicId) {
      utilJs.getMethod(
        global.apiurl + "paper/detail/" + this.paperMainId,
        res => {
          if (res.isGrounding == 0) {
            this.$routerGo(this, "replace", {
              path: "/error/emptyPage",
              query: {
                info: "很抱歉，该考试不存在"
              }
            });
          }
          if ((res.price * 1 > 0 && res.isGrounding == -1 && !res.permission) || (res.price * 1 == 0 && res.isGrounding == -1)) {
            this.$routerGo(this, "replace", {
              path: "/error/emptyPage",
              query: {
                info: '很抱歉，该考试已下架'
              }
            })
          }
          $this.examinationInfo = res
          this.wechatShare();
        }
      );
      return;
    }
    utilJs.getMethod(global.apiurl + 'exam/topicDetail/' + this.topicId, function (res) {
      if ($this.isRelevance != 1 && res.permission != 1) {
        $this.$routerGo($this, "push", {
          path: "/homePage/examination/examinationDetail",
          query: { ExaminationNo: $this.topicId }
        });
      }

      $this.examinationInfo = res.topicInfo;

      $this.wechatShare();
    })
  },
  deactivated() {

  },
  computed: {},
  watch: {},
  methods: {
    drawNowCom() {
      let ckFrom = global.ckFrom.testpPaper
      this.$refs.examCerNew.drawNow(this.topicId, this.paperMainId, ckFrom)
    },
    //点击开始播放音频
    clickPlayAudio(audioUrl) {
      let audio = document.getElementById("audioSelf");
      if (this.playAduioSrc == audioUrl) {
        this.playAduioSrc = "";
        document.getElementById("audioSelf").src = this.playAduioSrc;
        return;
      }
      this.playAduioSrc = audioUrl;

      if (this.playAduioSrc && this.playAduioSrc.includes("http")) {
        document.getElementById("audioSelf").src = this.playAduioSrc;
        audio.play();
      }
    },

    //监听音频播放结束执行的内容
    playAudioSelfEnd() {
      this.playAduioSrc = "";
      document.getElementById("audioSelf").src = this.playAduioSrc;
    },
    clickItem(type, id) {
      let courseType = type == 1051 ? 0 : type == 1052 ? 1 : type == 1053 ? 2 : '';
      let prodType = type == 1051 || type == 1052 || type == 1053 ? global.ckFrom.course : type;
      goDetails(this, prodType, id, '', courseType)
    },
    setProgress: function (isDrawReward) {
      let data = {
        ttId: this.ttId, //营期ID
        tpId: this.tpId, //环节ID
        tlId: this.tlId, //课时ID
        ratio: isDrawReward == 1 ? 0 : 100, //完成进度0-100
        duration: this.duration
      }
      utilJs.postMethod(global.apiurl + 'k12/trainings/progress', data, function (res) { });
    },
    clickGoDetail(prodType, id, courseType) {
      if (prodType == global.ckFrom.package) {
        this.$routerGo(this, "push", {
          path: '/homePage/package/packageDetail',
          query: {combosId:id}
        });
      } else if (prodType == global.ckFrom.camp) {
        this.$routerGo(this, "push", {
          path: '/homePage/camp/campDetail',
          query: {campId:id}
        });
      } else if (prodType == global.ckFrom.course) {
        switch (courseType) {
          case 0:
            this.$routerGo(this, "push", {
              path: "/homePage/course/video",
              query: {
                courseId: id,
                extId: -1,
                ckFrom: global.ckFrom.course
              }
            });
            break;
          case 1:
            this.$routerGo(this, "push", {
              path: "/homePage/course/voice",
              query: {
                courseId: id,
                extId: -1,
                ckFrom: global.ckFrom.course
              }
            });
            break;
          case 2:
            this.$routerGo(this, "push", {
              path: "/homePage/course/imgText",
              query: {
                courseId: id,
                extId: -1,
                ckFrom: global.ckFrom.course
              }
            });
          break;
        }
      } else if (prodType == global.ckFrom.column) {
        this.$routerGo(this, "push", {
          path: "/homePage/column/columnDetail",
          query: {
            cId: -1,
            extId: id,
            ckFrom: global.ckFrom.column
          }
        });
      }
    },
    goMyCoupon() {
      this.$routerGo(this, "push", {
        path: '/member/myValueVoucher/myValueVoucher',
        query: {}
      });
    },
    goMyPoint() {
      this.$routerGo(this, "push", {
        path: '/member/myIntegral/integralDetail',
        query: {}
      });
    },
    getCoupons() {
      let $this = this;
      this.isShowLoading = true;
      let codeArray = this.testRes.reddemCode.map(c => c.redeemCodeId || c.id);
      let countArray = this.testRes.reddemCode.map(c => c.couponNum);
      utilJs.postMethod(global.apiurl + 'redeemCodes/autoCollectRedeemCode', { arrRedeemCode: codeArray, type: -1, source: 10, arrCouponNum: countArray }, function (res) {
        $this.getNum = res.hasCollectNum;
        $this.drawReward($this.testRes.rewardType, $this.testRes.redeemCodeId, -1);
      }, function (failRes) {
        $this.failGet = true;
        $this.isShowLoading = false;
      });
    },
    drawReward(rType, redeemCodeId, points, ckFrom) {
      let rData = {
        type: rType,
        paperMainId: this.paperMainId,
        ckFrom: ckFrom || ''
      }
      if (redeemCodeId != -1) {
        rData.redeemCodeId = redeemCodeId;
      }
      if (points != -1) {
        rData.points = points;
      }
      this.isShowLoading = true;
      let $this = this;
      utilJs.postMethod(global.apiurl + 'exam/drawReward', rData, function (res) {
        $this.isShowLoading = false;
        if (redeemCodeId != -1 && $this.getNum == 0) {
          $this.failGet = true;
        } else {
           $this.successGet = true;
          if (points == -1) {
            $this.$showCjToast({
              text: '领取成功',
              type: 'success',
            })
          }
        }
      }, function (failRes) {
        $this.failGet = true;
        $this.isShowLoading = false;
      });
    },
    closeCg() {
      this.showCg = false;
    },
    clickGoList() {
      let $this = this
      utilJs.getMethod(global.apiurl + 'paper/checkOrignAllow?entryProdType=' + $this.testRes.entryProdType + '?prodId=' + $this.testRes.prodId + '?paperMainId=' + this.paperMainId, function (res) {
        if (res) {
          //考试详情
          if ($this.testRes.entryProdType == 1) {
            $this.$routerGo($this, "push", {
              path: "/homePage/testPaper/testDetail",
              query: {
                testId: $this.paperMainId
              }
            });
            //测评
          } else if ($this.testRes.entryProdType == 2) {
            $this.$routerGo($this, "push", {
              path: "/homePage/examination/examinationDetail",
              query: { ExaminationNo: $this.topicId }
            });
            //训练营
          } else if ($this.testRes.entryProdType == 3) {
            $this.$routerGo($this, "push", {
              path: "homePage/camp/campDetail",
              query: { campId: $this.prodId, ckFrom: global.ckFrom.camp }
            });
          } else {
            $this.$router.go(-1);
          }
        } else {
          $this.$routerGo($this, "push", { path: "/" });
        }
      })
    },
    goNextExam() {
      if (this.testRes.nextId != 0) {
        this.$routerGo(this, "replace", {
          path: '/homePage/examination/nextExamination',
          query: { nextPaperMainId: this.testRes.nextId, topicId: this.topicId, goOnNum: this.testRes.goOnNum, type: this.testRes.type, examStatus: this.testRes.examStatus }
        });
      } else {
        this.showCg = false;
      }
    },
    goAnalysis: function (num) {
      if (this.testRes.enableShowAnswer != 0) {
        let queryStr = `?examMainId=${this.testRes.examMainId}&paperMainId=${this.paperMainId}&topicId=${this.topicId}&num=${num}`;
        if (this.isRelevance == 1) {
          queryStr = `${queryStr}&isRelevance=1&mun=${num}`
        }
        this.$routerGo(this, "push", {
          path: `/homePage/examination/examinationAnswerAnalyze${queryStr}`,
        });
      }
    },
    ranking: function (eId) {
      this.$routerGo(this, "push", {
        path: '/homePage/examination/examinationRank',
        query: { paperMainId: this.paperMainId }
      });
    },
    examShare: function (eId) {
      if (this.bindPhoneSetting && this.bindPhoneSetting.shareBind) {
        if (utilJs.goBindMobile()) return;
      }
      let showVisitInlet = true
      if (this.cfg && this.cfg.enableShowloduleview && !this.cfg.enableHiddenlodules(this.testRes.visitInlet.prodType)) {
        showVisitInlet = true
      } else {
        showVisitInlet = false
      }
      let showScore = 1
      if (this.testRes.enableShowScore == 0 || !(this.testRes.enableRating == -1 || (this.testRes.enableRating == 1 && this.testRes.isCheck != -1))) {
        showScore = 0
      }
      this.$routerGo(this, "push", {
        path: '/homePage/examination/examinationResultSpread',
        query: { paperMainId: this.paperMainId, topicId: this.topicId, showVisitInlet:showVisitInlet, enableShowScore:showScore }
      });
    },
    goTest: function (eId) {
      //    this.$emit("testAgain",eId);
      let nt = (new Date()).getTime();
      let lt = utilJs.getTimeByDate(this.testRes.lastJoinTime);
      if ((this.testRes.intervalTime != 0) && (lt + this.testRes.intervalTime * 60 * 1000 > nt)) {
        let interval = lt + (this.testRes.intervalTime * 60 * 1000) - nt;
        let secondTime = parseInt(interval / 1000);
        let minuteTime = 0;
        if (secondTime > 60) {
          minuteTime = parseInt(secondTime / 60);
          secondTime = parseInt(secondTime % 60);
        }
        let showTime = minuteTime > 0 ? (minuteTime + '分' + secondTime + '秒') : (secondTime + '秒')
        this.$showCjToast({
          text: '请在' + showTime + '后重测',
          type: "text",
        });
      } else {
        let $this = this;
        if ($this.testRes.hasPermission != 1) {
          $this.clickGoList()
        } else {
          let data = {
            paperMainId:$this.paperMainId,
            topicId:$this.topicId,
            goOnNum:1,
            isRelevance:$this.isRelevance,
            ttId: $this.ttId,
            tlId: $this.tlId,
            tpId: $this.tpId
          }
          if ($this.testRes.inProgress) {
            data.goOnNum = $this.testRes.inProgress.goNum
          }
          console.log(data)
          utilJs.getMethod(global.apiurl + 'paper/judgeEntry/' + $this.paperMainId, function (res) {
            if (res.status == 1) {
              if ($this.testRes.inProgress) {
                $this.$routerGo($this, "replace", {
                  path: "/homePage/examination/examinationAnswer",
                  query: data
                });
              } else {
                utilJs.postMethod(global.apiurl + "paperLibrary/createExam", {
                  paperMainId: $this.paperMainId,
                  topicId:$this.topicId,
                  ckFrom:1
                }, res => {
                  $this.$routerGo($this, "replace", {
                    path: "/homePage/examination/examinationAnswer",
                    query: data
                  });
                })
              }
            } else {
              $this.$showCjToast({
                text: res.msg + '</br>' + res.showTime,
                type: 'warn'
              });
            }
          })
        }
      }
    },
    //分享
    wechatShare: function () {
      let title = this.examinationInfo.shareTitle;
      let shareImg = this.examinationInfo.sharePic || require('../../../assets/examination_defult.png');
      let shareDesc = this.examinationInfo.shareDesc;//"共包含"+this.examinationInfo.hasPaper+"套考卷";
      let shareUrl = ''
      if (this.topicId) {
        shareUrl = `${window.location.href.split("#")[0]}#/homePage/examination/examinationDetail?ExaminationNo=${this.topicId}&refereeId=${localStorage.getItem("userId")}`;
      } else {
        shareUrl = `${window.location.href.split("#")[0]}#/homePage/testPaper/testDetail?testId=${this.paperMainId}&refereeId=${localStorage.getItem("userId")}`;
      }
      utilJs.wechatConfig(shareUrl, title, shareImg, shareDesc, function () { }, true);
    },
    //手机端分享
    appShare: function () {
      let title = this.examinationInfo.shareTitle;
      let shareImg = this.examinationInfo.sharePic || require('../../../assets/examination_defult.png');
      let shareUrl = ''
      if (this.topicId) {
        shareUrl = window.location.href.split("#")[0] + '#/homePage/examination/examinationDetail?ExaminationNo=' + this.topicId + '&refereeId=' + localStorage.getItem("userId");
      } else {
        shareUrl = `${window.location.href.split("#")[0]}#/homePage/testPaper/testDetail?testId=${this.paperMainId}&refereeId=${localStorage.getItem("userId")}`;
      }

      var shareDesc = this.examinationInfo.shareDesc;
      utilJs.appShareTrue(title, shareImg, shareUrl, shareDesc);
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->

<style scoped>
.c-maxh106 {
  max-height: 2.65rem;
}
.c-pb84 {
  padding-bottom: 2.1rem;
}
.pass1 {
  width: 14rem;
  height: 9.3rem;
  padding-top: 6.8rem;
  background: url("https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/i/wap/exam/pass1.png") no-repeat left top;
  background-size: 100% 100%;
}
.pass2 {
  width: 14rem;
  height: 12.6rem;
  padding-top: 6rem;
  background: url("https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/i/wap/exam/pass2.png") no-repeat left top;
  background-size: 100% 100%;
}
.pass4 {
  width: 14rem;
  height: 14rem;
  padding-top: 6rem;
  background: url("https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/i/wap/exam/pass4.png") no-repeat left top;
  background-size: 100% 100%;
}
.pass3 {
  width: 14rem;
  height: 11.3rem;
  padding-top: 6.3rem;
  background: url("https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/i/wap/exam/pass3.png") no-repeat left top;
  background-size: 100% 100%;
}
.fail {
  width: 14rem;
  height: 8.5rem;
  padding-top: 5.6rem;
  background: url("https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/i/wap/exam/fail.png") no-repeat left top;
  background-size: 100% 100%;
}
.cg-next {
  color: #852f00;
}
.cg-bg {
  background: linear-gradient(
    0deg,
    rgba(255, 233, 102, 1),
    rgba(255, 193, 56, 1)
  );
  border-radius: 0.75rem;
}
.exchange-left {
  background: url("../../../../public/i/wap/coupon/coupon_left.png") no-repeat
    100%;
  background-size: 100% 100%;
}
.dh-left {
  background: url("../../../../public/i/wap/coupon/exchange.png") no-repeat 100%;
  background-size: 100% 100%;
}
.coupon-bd {
  border-top: 1px solid #e6e6e6;
  border-right: 1px solid #e6e6e6;
  border-bottom: 1px solid #e6e6e6;
}
.coupon-text-fc {
  color: #ffc138;
}
.certificate {
  background: rgba(251, 180, 73, 0.1);
  border-radius: 28px 0px 0px 28px;
}
.score-text {
  margin-left: -0.4rem;
}
.bg-linearColor{
  background: linear-gradient(90deg,#9aaaff, #6c83ff);
}
.bg-linearColorTop{
  background: linear-gradient(180deg,#6c83ff, #99aaff)
}
.c-fc-linerColorRed{
    background-image: linear-gradient(133deg,#ffbbbb, #f56c6c);
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
}
.canvasBox {
  width: 750px;
  height: 1334px;
  top: -999999999px;
  left: -30000000px;
  z-index: -999;
  position: absolute;
}
.anvasContent {
  width: 750px;
  height: 1334px;
  position: relative;
}
.bgLocation {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
}
.c-clbu{
  color: #7D91FF;
}
.c-mt-180{
  margin-top: -4.5rem;
}
.c-boxShadow10{
  box-shadow: 0 0 0.5rem 0 rgba(0,0,0,0.10);
}
.box {
  box-sizing: border-box;
  position: relative;
}
.wifi-symbol {
  width: 1rem;
  height: 1rem;
  overflow: hidden;
  position: relative;
  transform: rotate(135deg);
  -webkit-transform-origin: center;
  transform-origin: center;
  -webkit-transform: translate3d(135deg,0,0);
  -webkit-backface-visibility: hidden;
}
.wifi-circle {
  /* border: 0.1rem solid #999999; */
  border-radius: 50%;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  position: absolute;
  -webkit-transform: translate3d(0,0,0);
}

.first {
  width: 0.1rem;
  height: 0.1rem;
  background: #cccccc;
  top: 0.9rem;
  left: 0.9rem;
}
.second {
  width: 0.5rem;
  height: 0.5rem;
  top: 0.7rem;
  left: 0.7rem;
}
.seconAnimation{
  animation: fadeInOut 1s infinite 0.2s;
}
.third {
  width: 0.8rem;
  height: 0.8rem;
  top: 0.5rem;
  left: 0.5rem;
}
.thirdAnimation{
  animation: fadeInOut 1s infinite 0.4s;
}
@keyframes fadeInOut {
    0% {
        opacity: 0; /*初始状态 透明度为0*/
    }
    100% {
        opacity: 1; /*结尾状态 透明度为1*/
    }
}
</style>